<!doctype html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="{{asset('/css/mdui.min.css')}}">
    <style>
        body {
            background: #f5f5f5 url("{{asset('/images/auth_bg.gif')}}");
        }

        .auth-warp {
            width: 820px;
            margin: 0 auto;
            padding-top: 20px;
            padding-bottom: 20px;
        }

        .logo {
            width: 150px;
            margin: 0 auto;
            margin-bottom: 30px;
        }

        .logo a i {
            font-size: 100px;
            line-height: 100px;
        }

        .form-container {
            background-color: #fff;
            border-radius: 5px;
        }

        .left-side {
            border-right: 2px solid #fafafa;
        }
    </style>
    @yield('css')
    <title>@yield('title','微博')</title>
</head>
<body class="mdui-theme-primary-blue mdui-theme-accent-blue">
<div class="auth-warp">
    {{--logo--}}
    <div class="logo mdui-valign">
        <a href="{{url('/')}}" class="mdui-center">
            <i class="mdui-icon material-icons ">all_inclusive</i>
        </a>
    </div>
    {{--表单容器--}}
    <div class="mdui-container mdui-shadow-5 form-container">
        <div class="mdui-row mdui-p-a-3">
            <div class="psw">
                <form action="{{url('/u/'.Session::get('user.id').'/password')}}" method="post">
                    {{csrf_field()}}
                    <div class="mdui-textfield mdui-textfield-floating-label">
                        <label class="mdui-textfield-label">原密码</label>
                        <input class="mdui-textfield-input" name="old" type="password" required/>
                        @if(count($errors) > 0)
                            <div class="mdui-textfield-error">{{$errors->first('old')}}</div>
                        @endif
                        {{session('fails')}}
                        {{(isset($msg1))?$msg1:''}}
                    </div>

                    <div class="mdui-textfield mdui-textfield-floating-label">
                        <label class="mdui-textfield-label">请输入6位以上新密码</label>
                        <input class="mdui-textfield-input" name="password" type="password" required/>
                        @if(count($errors) > 0)
                            <div class="mdui-textfield-error">{{$errors->first('password')}}</div>
                        @endif
                        {{session('fails')}}
                    </div>

                    <div class="mdui-textfield mdui-textfield-floating-label">
                        <label class="mdui-textfield-label">请重复输入新密码</label>
                        <input class="mdui-textfield-input" name="password_confirmation" type="password" required/>
                        @if(count($errors) > 0)
                            <div class="mdui-textfield-error">{{$errors->first('password_confirmation')}}</div>
                        @endif
                        {{session('fails')}}
                    </div>
                    <button class="mdui-btn mdui-ripple mdui-color-blue" id="submit" type="submit">提交</button>
                    <a class="mdui-btn mdui-ripple" href="{{url('/u/'.Session::get('user.id').'/edit')}}">返回</a>
                    <p class="mdui-text-color-green">
                        <span>{{(isset($msg2))?$msg2:''}}</span>
                    </p>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="{{asset('/js/jquery-1.8.3.min.js')}}"></script>
<script src="{{asset('/js/jquery.validate.min.js')}}"></script>
<script src="{{asset('/js/mdui.min.js')}}"></script>
@yield('js')

</body>
</html>